package com.platform.job;

import com.alipay.api.AlipayApiException;
import com.platform.entity.UserOrder;
import com.platform.service.OrderService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Component
public class Job {

    @Resource
    private OrderService orderService;

    @Scheduled(fixedRate = 5000) // 每隔5秒执行一次
    public void myTask() throws AlipayApiException {
        // 定时任务逻辑
        System.out.println("定时任务执行了");
         orderService.seeAllUnPay();
    }

}
